package shuishijie.suishijie.model;



import java.util.List;

import shuishijie.suishijie.util.AppUtil;

/**
 * Created by mindx on 2017/8/29.
 */

public class HotTime {
    /**
     * 限时活动id
     **/
    public String hotTime_id;
    /**
     * 热卖名称
     **/
    public String group_name;
    /**
     * 状态
     **/
    public int hotTimeStatus;
    /**
     * 开始时间
     **/
    public String beginTime;
    /**
     * 结束时间
     **/
    public String endTime;
    public String todaytime;

    /**
     * 数据
     **/
    public List<HotTimeGoodsInfo> list;
    public long dd;
    public long hh;
    public long mm;
    public long ss;

    public void timeCalc() {
        // TODO: 2017/9/13 zhangrl
        long now = System.currentTimeMillis();
        long end = AppUtil.parserDate(endTime).getTime();
        dd = (end - now) / (24 * 60 * 60 * 1000);
        hh = ((end - now) / (60 * 60 * 1000)) % 24;
        mm = ((end - now) / (60 * 1000)) % 60;
        ss = ((end - now) / (1000)) % 60;
        if (dd < 0) dd = 0;
        if (hh < 0) hh = 0;
        if (mm < 0) mm = 0;
        if (ss < 0) ss = 0;
    }
}
